package com.own.core.html.table;

import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationLink;
import org.apache.wicket.markup.html.navigation.paging.IPageable;

public class OwnAjaxPagingNavigationLink extends AjaxPagingNavigationLink {

	public OwnAjaxPagingNavigationLink(String id, IPageable pageable,
			int pageNumber) {
		super(id, pageable, pageNumber);
	 
	}
	@Override
	protected int cullPageNumber(int pageNumber)
	{
		int idx = pageNumber;
		if (idx < 0)
		{
			idx = pageable.getPageCount() + idx;
		}

		if (idx > (pageable.getPageCount() - 1))
		{
			idx = pageable.getPageCount() - 1;
		}

		if (idx < 0)
		{
			idx = 0;
		}
//		 ((OwnAjaxFallbackDefaultDataTable)pageable).setRowsPerPage(10000);
		return 1;
	}
//	@Override
//	public void onClick()
//	{((OwnAjaxFallbackDefaultDataTable)pageable).setRowsPerPage(10000);
//		onClick(null);
//	}

}
